<?php 
/**
 * This file is part of the Anota project.
 * 2011-2012 Fernando Garcia Huerta <fgarciahue@uoc.edu>
 * 
 * UOC - FUNDAMENTOS DE INFORMÁTICA EN ENTORNOS BIOINFORMÁTICOS - PEC2
 */

/**
 * templateAnnotate
 *  - main form of the application
 * 
 * @package    Anota
 * @subpackage application/template
 * @author     Fernando Garcia Huerta <fgarciahue@uoc.edu>
 */
?>
<div class="bloque">
    <form method="POST" enctype="multipart/form-data" action="index.php" name="data">
        <input type="hidden" name="module" value="Annotate" />
        <input type="hidden" name="action" value="Form" />
        <h2>Input data</h2>
        <ul>
            <?php if ($this->config->getUser()->existError('input_file')): ?>
                <li class="error">
                    <?php echo $this->config->getUser()->getError('input_file') ?>
                </li>
            <?php endif ?>
            <li>
                <input type="file" name="input_file" id="input_file"/>
                <label for="input_file">Select input file (fasta format)</label>
            </li>
        </ul>
        <input type="submit" value="Enviar"></input>

        <h2>Select genomic elements to display</h2>
        <ul>
            <?php if ($this->config->getUser()->existError('display_option')): ?>
                <li class="error">
                    <?php echo $this->config->getUser()->getError('display_option') ?>
                </li>
            <?php endif ?>
            <?php foreach ($this->config->getDisplayOptions() as $key => $value): ?>
                <?php $display_option_id = 'display_option_' . $key ?>
                <?php $display_option_name = 'display_option[' . $key . ']' ?>
                <li>
                    <input type="checkbox" 
                           name="<?php echo $display_option_name ?>" 
                           id="<?php echo $display_option_id ?>"/>
                    <label for="<?php echo $display_option_id ?>">
                        <?php echo $value . ' <em>[-' . $key . ']</em>' ?>
                    </label>
                </li>
            <?php endforeach ?>
        </ul>

        <h2>Select output format</h2>
        <ul>
            <?php if ($this->config->getUser()->existError('output_option')): ?>
                <li class="error">
                    <?php echo $this->config->getUser()->getError('output_option') ?>
                </li>
            <?php endif ?>
            
            <?php foreach ($this->config->getOutputOptions() as $key => $value): ?>
                <?php $output_option_id = 'output_option_' . $value['option'] ?>
                <li>
                    <input type="radio" 
                           name="output_option" 
                           value="<?php echo $value['option'] ?>" 
                           id = "<?php echo $output_option_id ?>"
                           <?php if ($this->config->getDefault('output_option') == $key)
                               echo ' checked' ?> />
                    <label for="<?php echo $output_option_id ?>">
                        <?php echo $value['label'] . ' <em>[-' . $value['option'] . ']</em>' ?>
                    </label>
                </li>
            <?php endforeach ?>
        </ul>

        <h2>Select control prediction engine</h2>
        <h3>Strands</h3>
        <ul>
            <?php if ($this->config->getUser()->existError('strand_options')): ?>
                <li class="error">
                    <?php echo $this->config->getUser()->getError('strand_options') ?>
                </li>
            <?php endif ?>
            
            <?php foreach ($this->config->getStrandOptions() as $key => $value): ?>
                <?php $strand_option_id = 'strand_option_' . $value['option'] ?>
                <li>
                    <input type="radio" 
                           name="strand_options" 
                           value="<?php echo $value['option'] ?>" 
                           id="<?php echo $strand_option_id ?>"
                           <?php if ($this->config->getDefault('strand_option') == $key)
                               echo ' checked' ?> />
                    <label for="<?php echo $strand_option_id ?>">
                        <?php echo $value['label'] . ' <em>[-' . $value['option'] . ']</em>' ?>
                    </label>
                </li>
            <?php endforeach ?>
        </ul>
        
        <h3>Engine</h3>
        <ul>
            <?php if ($this->config->getUser()->existError('engine_options')): ?>
                <li class="error">
                    <?php echo $config->getUser()->getError('engine_options') ?>
                </li>
            <?php endif ?>
            
            <?php foreach ($this->config->getEngineOptions() as $key => $value): ?>
                <?php $engine_option_id = 'engine_option_' . $value['option'] ?>
                <li>
                    <input type="radio" 
                           name="engine_options" 
                           value="<?php echo $value['option'] ?>" 
                           id="<?php echo $engine_option_id ?>"
                           <?php if ($this->config->getDefault('engine_option') == $key)
                               echo ' checked' ?> />
                    <label for="<?php echo $engine_option_id ?>">
                        <?php echo $value['label'] . ' <em>[-' . $value['option'] . ']</em>' ?>
                    </label>
                </li>
            <?php endforeach ?>                
        </ul>

        <h2>Re-annotation of sequences</h2>
        <ul>
            <li>(todo list) -R: Include annotations (evidences) provided from file. </li>
            <li>(todo list) -S: Use homology to protein information (SR) provided from file.</li>
        </ul>

        <h2>Statistical model</h2>
        <ul>
            <li>(todo list) -E: Increase/decrease exon weight value.</li>
        </ul>

        <h3>Parameter file</h3>
        <ul>
            <?php if ($this->config->getUser()->existError('param_option')): ?>
                <li class="error">
                    <?php echo $this->config->getUser()->getError('param_option') ?>
                </li>
            <?php endif ?>
            
            <?php foreach ($this->config->getParamfileOptions() as $file => $param_file): ?>
                <li>
                    <input type="radio" 
                           name="param_option" 
                           value="<?php echo $file ?>" 
                           id="<?php echo $param_file['id'] ?>" 
                           <?php if ($file == $this->config->getDefault('param_file'))
                               echo " checked" ?> />
                    <label for="<?php echo $param_file['id'] ?>">
                        <a href="<?php echo $param_file['relative_path_file'] ?>" target="blank"><?php echo $param_file['label'] ?></a>
                    </label>
                </li>                
            <?php endforeach ?>
            <li>(todo list) -P: Or provide a new parameter file.</li>
        </ul>

        <input type="submit" value="Enviar"></input>

    </form>
</div>
